<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button type="button" id="btn1"  onclick="a()" >注册1</button>
    <button type="button" id="btn2"   >注册2</button>
</body>
</body>
</html>

<script>
    function a(){
    console.log(12341);
}
</script>
<!-- 
<script>  
// function a(){
//     console.log(12341);
// }
    // var btn1 = document.getElementById("btn1");
    // var btn2 = document.getElementById("btn2");
    // window.onload = function() {
    //     btn1.onclick =  ()=>{
    //         console.log("btn1 clicked");
    //     };
    //     btn2.onclick =  function(){
    //         console.log(this );
    //         console.log("btn2 clicked");
    //     };
    // }

  

</script> -->